package com.example.month11.fragment1.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import androidx.fragment.app.Fragment;
import com.example.recyclerview01.R;

/**
 * @Author Tom
 * @Date 2023/11/16 16:30
 */
public class TitleFragment extends Fragment {

    /**
     * fragment第一次创建绘制用户页面时，系统回调的方法。
     * container: 表示当前fragment插入activity布局视图的对象。
     */
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_title, null);
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        view.findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getActivity(), "back click, ",Toast.LENGTH_SHORT).show();
            }
        });
    }

}
